package com.hruiworks.campusgroup.common;

import com.hruiworks.campusgroup.enums.ErrorCode;
import com.hruiworks.campusgroup.enums.SuccessCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 用于返回sse相关的数据
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SseBaseResponse<T> extends BaseResponse<T> {

    /**
     * 各类sse标识
     */
    private String messageType;


    public SseBaseResponse(int code, T data, String message, String description, String messageType) {
        super(code, data, message, description);
        this.messageType = messageType;
    }

    public SseBaseResponse(T data, SuccessCode successCode, String messageType) {
        super(data, successCode);
        this.messageType = messageType;
    }

    public SseBaseResponse(ErrorCode errorCode, String messageType) {
        super(errorCode);
        this.messageType = messageType;
    }
}
